package com.wolf.etl.core.transform;

import com.wolf.etl.vo.ColumnDesc;
import com.wolf.vo.BaseResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;
import java.util.Map;

/**
 * Created by tommy's father on 2017/8/30.
 */
public abstract class AbstractDynamicTransform {

    private static Logger logger = LoggerFactory.getLogger(AbstractDynamicTransform.class);

    private static final String logger_prefix = "wolf-etl#com.wolf.etl.core.transform#AbstractDynamicTransform";


    protected AbstractTransform transform;
    public abstract BaseResult doTransform(List<Map<String, ColumnDesc>> records);

    private static final Object lock = new Object();

    public static AbstractDynamicTransform getInstance(AbstractTransform transform) {
        synchronized (lock) {
            AbstractDynamicTransform dynamicTransform = new DefaultDynamicTransform();
            dynamicTransform.transform = transform;
            return dynamicTransform;
        }
    }
}
